<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    #mycanvas {
      background: skyblue;
    }
  </style>
</head>

<body>
  <canvas id="mycanvas" width="400" height="500"></canvas>
  <script>
    var mycanvas = document.getElementById("mycanvas")
    var context = mycanvas.getContext("2d");
    context.fillStyle = "#00ff00";
    context.fillRect(0, 0, 200, 200) //画一个矩形
    context.stroke()
    context.fillStyle = "#ff0000"
    context.moveTo(160, 100)
    context.arc(100, 100, 60, 0, 2 * Math.PI)
    context.moveTo(140, 100)
    context.arc(100, 100, 40, 0, Math.PI)
    context.moveTo(85, 80)
    context.arc(80, 80, 5, 0, 2 * Math.PI)
    context.moveTo(125, 80)
    context.arc(120, 80, 5, 0, 2 * Math.PI)
    context.stroke()
  </script>
</body>

</html>